package edu.chinasoft.service;

import edu.chinasoft.dao.UserDao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service(value = "userService")
public
class UserServiceImp implements UserService {
    private Log log = LogFactory.getLog(UserServiceImp.class);
    private UserDao userDao;
@Override

    public void register() {
    log.info("UserServiceImp>>>register  start ……");
    userDao.insert();
    log.info("UserServiceImp>>>register  end ……");
    }

    public UserDao getUserDao(){
    return userDao;
    }
    //类型注入：把ioc容器里类型与UserDao一致的对象注入进来。   对象  instanof   UserDao
    @Autowired
    @Qualifier(value = "userDao02")
   // @Resource(name = "userDao02")
    public void
    setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
}
